package com.xy.open.feign.http.service.fall.back;
import com.alibaba.fastjson.JSON;
import com.xy.common.base.entity.AjaxResult;
import com.xy.open.feign.http.service.JmUserCallService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * 准备假面用户微服务兜底数据，当获取数据失败的时候返回的数据，比如请求数据失败
 */
@Slf4j
@Service
public class JmUserCallServiceFallback implements JmUserCallService {
    @Override
    public AjaxResult GetRootList() {
        log.info("触发兜底数据：GetRootList");
        return get_default_root_list();
    }

    @Override
    public AjaxResult FindAuthenticateData(Integer authenticate_id) {
        log.info("触发兜底数据：FindAuthenticateData");
        String data="{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"ip\":\"0:0:0:0:0:0:0:1:905\",\"authenticate_info\":{\"authenticateId\":204,\"userId\":2480,\"authenticateType\":1,\"authenticateImg\":\"/image/20200401/15857284155e844b9f1dbe1.jpg\",\"createTime\":\"2020-04-01T08:06:54.000+00:00\",\"authenticateAccuracy\":100,\"authenticateMark\":\"100\",\"status\":1,\"statusModAdmin\":null,\"statusModTime\":null,\"statusDesc\":null}}}";
        return AjaxResult.success(JSON.parseObject(data).get("data"));
    }
    private AjaxResult get_default_root_list(){
        String data="{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"ip\":\"0:0:0:0:0:0:0:1:905\",\"list\":{\"userId\":1024,\"userName\":\"柠檬水，\",\"userBirthday\":\"1998-07-25T16:00:00.000+00:00\",\"userCareer\":62,\"userGender\":2,\"userPhone\":null,\"userAvatar\":\"/mianju/import/head/1585723795727/head.jpg\",\"password\":\"8fb08542e00b0d0aecadfde9fe830cf4\",\"passwordSecret\":\"asdhjajsdhjasdgyuagsdubaixhuihxusds2242144^^&&%%agdsuajazhxj\",\"regChannel\":4,\"createTime\":\"2020-04-01T06:48:30.000+00:00\",\"modifiedTime\":null,\"weChatOpenid\":null,\"weChatPartId\":null,\"qqOpenid\":null,\"qqPartId\":null,\"applePartId\":null,\"status\":1,\"loginIp\":\"125.70.179.159\",\"loginTime\":\"2020-04-01T06:48:30.000+00:00\",\"statusDesc\":null,\"statusModAdmin\":null,\"statusModTime\":null,\"lbsPosX\":121472644,\"lbsPosY\":31231706,\"lbsPosZ\":0,\"lbsType\":0,\"lbsPosCountry\":100000,\"lbsPosProvince\":289,\"lbsPosCity\":310100,\"lbsPosArea\":310101,\"lbsPosDetail\":\"上海市上海城区黄浦区\",\"regCity\":310100,\"lastLoginCity\":310100,\"lastLoginSystemOs\":\"IOS\",\"lastUseTime\":1611091090,\"expectFriendsKinds\":28,\"expectActivates\":196,\"qq\":\"940100100\",\"wx\":\"940100100\",\"bodyHeight\":\"166CM\",\"bodyWeight\":\"45KG\",\"isHideSocialInfo\":1,\"albumAuthType\":2,\"intro\":\"我在等你哟。\",\"inviteUserId\":0,\"regMethod\":4,\"regFromChannel\":null,\"userType\":2,\"realPeopleStatus\":1,\"goddessStatus\":1,\"memberStartTime\":null,\"memberEndTime\":null,\"walletMoney\":0,\"walletWithdrawMoney\":0.0,\"maskMoney\":0,\"maskWithdrawMoney\":0.0,\"shareRewardMoney\":0.0,\"totalShareRewardMoney\":0.0,\"pushMessageDeviceToken\":null,\"dangerConfigId\":0,\"isOnline\":0,\"operationAdminId\":46,\"isAutoDrift\":0,\"mjId\":0,\"activatingUserId\":0,\"regInviteCode\":null,\"score\":0}}}";
        return AjaxResult.success(JSON.parseObject(data).get("data"));
    }
}
